package exam.demo1;

import java.util.*;

public class Test3 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        int[] arr = new int[n];
        for(int i = 0; i < n; i++) {
            arr[i] = scanner.nextInt();
        }

        int sum = 0;
        for(int i = 0; i < n; i++) {
            sum += arr[i];
        }

        for(int j = 0; j < k; j++) {
            int x = 0;
            int max = 0;
            for(int i = 0; i < n; i++) {
                if(arr[i] % 2 == 0) {
                    if(arr[i] > max) {
                        max = arr[i];
                        x = i;
                    }
                }
            }
            sum = sum - max / 2;
            arr[x] /= 2;
        }
        System.out.println(sum);
    }

}
